package com.common;

import java.text.SimpleDateFormat;

public class DateProcess {

	/**
	 * 将Date转换成字符格式
	 * @param input
	 * @return
	 */
	public static String convertToString(Object input,String formatString) {
		String ret = "";
		
		try
		{
			SimpleDateFormat sdf=new SimpleDateFormat(formatString); 
			
			if(input!=null)
			{
				if(input.toString().length()>0)
				{
					ret=sdf.format(input);
				}
			}
		}
		catch(Exception e)
		{
			ErrorLog.OnWrite(e);
		}

		return ret;
	}
	
	
}
